import request from '@/utils/myAioxs'
//获取支付方式

export function getOrderPayType() {
  return request({
    url: '/order/v1/course-order-confirm-pay-method',
    method: 'post',
  })
}
export function getOrderInfo(data) {
  return request({
    url: `/order/v1/get-order-to-pay-info`,
    method: 'post',
    data
  })
}
export function getChildOrder(orderId) {
  return request({
    url: `/order/v1/child-order/${orderId}`,
    method: 'get',
  })
}
//订单确认校验逻辑
export function getOrderCheck(data) {
  return request({
    url: '/order/v1/order-check',
    method: 'post',
    data
  })
}

//订单确认
export function getOrderConfirm(data) {
  return request({
    url: '/order/v1/order-confirm',
    method: 'post',
    data
  })
}

// 生成订单 并返回订单编号
export function createOrder(data) {
  return request({
    url: '/order/v1/create',
    method: 'post',
    data
  })
}

//微信唤起支付
export function payWechat(orderId) {
  return request({
    url: `/pay/v1/wechat/${orderId}`,
    method: 'get',
  })
}
//支付宝唤起支付
export function payAlipay(orderId) {
  return request({
    url: `/pay/v1/alipay/pc/${orderId}`,
    method: 'get',
  })
}
export function payZFTpay(orderId) {
  return request({
    url: `/pay/v1/zft-pay/pc/${orderId}`,
    method: 'get',
  })
}

//农行唤起支付
export function payAbcpay(orderId) {
  return request({
    url: `/pay/v1/abcpay/${orderId}`,
    method: 'get',
  })
}
//兰州银行行唤起支付
export function paylzbank(orderId) {
  return request({
    url: `/pay/v1/lzbank/${orderId}`,
    method: 'get',
  })
}
//订单监听接口
export function listenOrder(orderId) {
  return request({
    url: `/order/v1/listen/${orderId}`,
    method: 'get',
  })
}

//获取订单信息
export function getPayInfo(data) {
  return request({
    url: `/order/v1/get-order-to-pay-info`,
    method: 'post',
    data,
  })
}

